package com.hzau.tourist_service_sys.comtroller;

import com.hzau.tourist_service_sys.pojo.ScenicSpot.ScenicSpot;
import com.hzau.tourist_service_sys.pojo.ScenicSpot.TouristRoute;
import com.hzau.tourist_service_sys.result.Result;
import com.hzau.tourist_service_sys.service.ScenicSpotService;
import org.apache.logging.log4j.message.ReusableMessage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class ScenicSpotController {
   @Autowired
    ScenicSpotService scenicSpotService;
    @PostMapping("/scenic/selectAllSpot")
    public Result selectAllSpot( @RequestBody ScenicSpot scenicSpot){
        return scenicSpotService.selectAlSpot(scenicSpot.getPagenum(),scenicSpot);
    }
    @GetMapping("/scenic/selectSpotDetail/{spotId}")
    public Result selectSpotDetail(@PathVariable long spotId){
        return scenicSpotService.selectSpotDetail(spotId);
    }
    @PostMapping("/tourist/queryWay")
    public Result selectWayAll(@RequestBody TouristRoute touristRoute){
        System.out.println(touristRoute);
        return scenicSpotService.selectWayAll(touristRoute.getPagenum(),touristRoute);

    }
    @GetMapping("tourist/selectWayDetail/{routeId}")
    public Result selectWayDetail(@PathVariable long routeId){
        return scenicSpotService.selectWayDetail(routeId);
    }
}
